package com.fypg.module.medical.dal.mysql.smslog;

import com.fypg.framework.common.pojo.PageResult;
import com.fypg.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.fypg.framework.mybatis.core.mapper.BaseMapperX;
import com.fypg.module.medical.dal.dataobject.smslog.MedicalSmslogDO;
import org.apache.ibatis.annotations.Mapper;
import com.fypg.module.medical.controller.admin.smslog.vo.*;

/**
 * 短信发送记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SmslogMapper extends BaseMapperX<MedicalSmslogDO> {

    default PageResult<MedicalSmslogDO> selectPage(SmslogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MedicalSmslogDO>()
                .likeIfPresent(MedicalSmslogDO::getContent, reqVO.getContent())
                .likeIfPresent(MedicalSmslogDO::getMobilePhone, reqVO.getMobilePhone())
                .eqIfPresent(MedicalSmslogDO::getSendStatus, reqVO.getSendStatus())
                .eqIfPresent(MedicalSmslogDO::getSortCode, reqVO.getSortCode())
                .eqIfPresent(MedicalSmslogDO::getDescription, reqVO.getDescription())
                .eqIfPresent(MedicalSmslogDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(MedicalSmslogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MedicalSmslogDO::getId));
    }

}
